<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/common.jsp"%>
<title>供应商新增</title>
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form" action="" method="post">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所属平台：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="sysName" name="sysName" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="name" name="name" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>联系人：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="contacts" name="contacts" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>店铺链接：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="shopUrl" name="shopUrl" required="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">证件号：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="idCard" name="idCard">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">QQ号：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="qq" name="qq">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">旺旺：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="ww" name="ww">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">微信号：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="weixin" name="weixin">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">座机号：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="telPhone" name="telPhone">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">手机号：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="mobile" name="mobile">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">邮箱：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="email" name="email">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">联系地址：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="address" name="address">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" id="remark" name="remark">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-8 col-xs-offset-4 col-sm-offset-3">
                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
            </div>
        </div>
    </form>
</article>

<script type="text/javascript">
$(document).ready(function () {
	 $('#form').bind('submit', function () {
		var sysName = $("#sysName").val();
		var name = $("#name").val();
		var contacts = $("#contacts").val();
		var shopUrl = $("#shopUrl").val();
		var idCard = $("#idCard").val();
		var qq = $("#qq").val();
		var ww = $("#ww").val();
		var weixin = $("#weixin").val();
		var telPhone = $("#telPhone").val();
		var mobile = $("#mobile").val();
		var email = $("#email").val();
		var address = $("#address").val();
		var remark = $("#remark").val();
		$.ajax({
			type : 'POST',
			url : ctx + '/productManage/addSupplier.do',
			data : {
				sysName : sysName,
				name : name,
				contacts : contacts,
				shopUrl : shopUrl,
				idCard : idCard,
				qq : qq,
				ww : ww,
				weixin : weixin,
				telPhone: telPhone,
				mobile : mobile,
				email : email,
				address : address,
				remark : remark
			},
			dataType : 'json',
			timeout : 30000,
			context : $('body'),
			success : function(data) {
				if (data.code == "ok") {
                   layer.msg("保存成功!", {icon: 6, time: 1000}, function () {
                   	layer_close();
                   });
				} else {
					 layer.msg(data.msg, {icon: 5, time: 2000});
				}
			},
			error : function(xhr, type) {
				layer.msg('保存失败!', {icon: 5, time: 2000});
			}
		});
		  return false;
	 });
});
</script>
</body>
</html>